<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>50bus-剧本</title>
    <meta name="keywords" content="50bus" />
    <meta name="copyright" content="50bus.cn" />
    <!-- <meta http-equiv="mobile-agent" content="http://www.50bus.cn/" />
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" /> -->
    <link rel="icon" href="/resources/img/favicon.ico" type="image/x-icon" />
    
    <link rel="stylesheet" type="text/css" href="/resources/css/base.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/globe.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/module-script.css" media="all" />
    <link rel="stylesheet" type="text/css" href="resources/css/module-creative-dadong.css" />
    <script type="text/javascript" src="/resources/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/resources/js/jquery.form.js"></script>
    <script type="text/javascript" src="/resources/js/jquery.validate.js"></script>
    
</head>

<body>
    <div class="header_wrap">
        <div class="header clearfix">
            <div class="fm980 fl clearfix">
                <a href="/index.html" class="logo fl"></a>
                <ul class="nav_box fl">
                   <li><a href="/creative_list.html">形象创意</a></li>
                    <li><a href="/script_list.html" class="cur">剧本创作</a></li>
                    <li><a href="/render_index.html">动画渲染</a></li>
                    <li><a href="/creative_helper.html">创意助手</a></li>
                </ul>
                <div class="about_box fr">
                    <a href="/about.html">关于我们</a>
                     <#if uid??&&uid!="">
	                    <a href="/user/user_work.html">个人空间</a>
	                    <a href="/logout.html">退出</a>
                    <#else>
	                    <a href="/register.html">注册</a>
	                    <a href="/login.html">登录</a>
                    </#if>
                </div>
            </div>
        </div>

    </div>

    <div class="body_wrap">
        <div class="box_2">
            <div class="fm980">
                <div class="box_hd"><a href="script_list.html">剧本创作</a> &gt; <a href="script_collect_detail.html?sid=${scriptModel.sid}">${scriptModel.script_title}</a> &gt; 投稿编辑</div>
                <div class="box_bd">
                    <!-- 用户名称 -->
                    <div class="user_name clearfix">
                        <#if userModel.header_img?? && userModel.header_img!=''>
	                       <img class="r10 fl" style="width:20px;height:20px;" src="${userModel.header_img}" />
	                    <#else>
	                       <img class="r10 fl" style="width:20px;height:20px;" src="/resources/img/user_def_70.png" />
	                    </#if>
                        <span class="fz14 ml5 fl">${comp}</span>
                    </div>
                    <!-- 上传封面 -->
                    <div class="script_desc_box pb40">
                      <form id="script_form" action="script_contribute_editor_publish.json?sid=${scriptOwnModel.sid}&&own_sid=${scriptOwnModel.own_sid}&&create_time=${scriptOwnModel.create_time}" method="post">
                        <ul>
                            <li class="clearfix">
                                <label>标题：</label>
                                <p><input type="text" class="i_text" name="script_title_own"  value="${scriptOwnModel.script_title_own}" placeholder="20字以内" required="true" maxlength="20"/></p>
                            </li>
                            <li class="clearfix">
                                <label>剧本上传：</label>
                                <p class="upload_box">
                                    <span class="btn_com_red btn_upload upload_">选择文件</span>
                                    <span class="ml10"><#if scriptOwnModel.script_source_file??>${scriptOwnModel.script_source_file}<#else>还未选择文件</#if></span>
                                </p>
                            </li>
                            <li class="clearfix">
                                <label>故事梗概：</label>
                                <p><textarea class="i_text" name="essential" required="true" maxlength="2000" placeholder="2千字以内">${scriptOwnModel.essential}</textarea></p>
                            </li>
                            <li class="clearfix">
                                <p><input id="complete" type="submit" class="btn_com_purple mt10" value="完成" /></p>
                            </li>
                        </ul>
                        <div>
                        	<input id="script_upload" type="hidden" name="script_upload_url" value="${scriptOwnModel.script_source_file}" >
                        </div>
                      </form>
                    </div>
                </div>

            </div>

        </div>

    </div>

    <div class="footer">
        <div class="fm980 clearfix">
            <div class="foot_link foot_link1 fl">
                <a href="/creative_list.html">形象创意</a>
                <a href="/script_list.html">剧本创作</a>
                <a href="/render_index.html">动画渲染</a>
                <a href="/creative_helper.html" >创意助手</a>
            </div>
            <div class="foot_link foot_link2 fl">
                <a href="http://zjusp.zju.edu.cn/">浙大科技园</a>
                <a href="http://www.zju.edu.cn/">浙江大学</a>
                <a href="/about.html" >关于我们</a>
            </div>
            <div class="copy_box fr">
                <img class="mb5" src="/resources/img/foot_text.png" />
                <p>&copy; 2013-2016 All right reserved</p>
                <p><a href="">服务条款</a><a href="">隐私条款</a><a href="">法律条款</a></p>
                <p style="display:none;"><a href="" class="share_icon share_sina"></a><a href="" class="share_icon share_wx"></a></p>
            </div>
        </div>
    </div>
<link rel="stylesheet" href="/resources/kindeditor/themes/default/default.css" />
<script src="/resources/kindeditor/kindeditor.js"></script>
<script src="/resources/kindeditor/lang/zh_CN.js"></script>
<script>
	
$(function(){
		//验证表单
	$("#script_form").validate({
			messages: { 
		 	script_title_own: { 
					required: "请输入标题", 
					maxlength: "标题不能超过{0}字"
				}, 
		 			essential: { 
					required: "请输入故事概要",
					maxlength: "描述不能超过{0}字"
			    }
			},
			errorElement: "em",
			errorPlacement: function (error, element) { 
		  		if (element.is(':radio') || element.is(':checkbox')) {
		      		var eid = element.attr('name');
		      		error.appendTo(element.parent());
		  		} else {
		      		error.appendTo(element.closest("p"));
		 		}
			},
			submitHandler:function(form){
			formSubmit($("#script_form"));
			}
	});
	$("#complete").click(function(){
		$("#script_form").submit();
	});
	function formSubmit(form){
    form.ajaxSubmit({
        dataType: "json",              
        success: function(json)             
        {
        	location.href="script_contribute_list.html?sid=${scriptOwnModel.sid}&&own_sid=${scriptOwnModel.own_sid}&&attribute_uid=${scriptOwnModel.uid}";
        }
      });
	};	
		var editor = KindEditor.editor({
			allowFileManager : true
		});
		
		$('.btn_upload').click(function() {
			editor.loadPlugin('insertfile', function() {
				editor.plugin.fileDialog({
					showRemote : false,
					fileUrl  : $('.ml10').text(),
					clickFn : function(url, title) {
						$('.ml10').text(url);
						$("#script_upload").val(url);
						editor.hideDialog();
					}
				});
			});
		});
})

</script>
<script type="text/javascript" src="/resources/js/page-index.js"></script>
<script type="text/javascript">
	<#if uid??&&uid!="">
    	$.post("/common/getUserName.json",{"uid":${uid}},function(data){
    		if(data.name){
    			$('a[href="/user/user_work.html"]').html(data.name+"个人空间");
    		}
    	});
	 </#if>
</script>
</body>

</html>